<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}
    <!-- jqgrid-->
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link rel="stylesheet" href="__STATIC__/layout/css/zTreeStyle.css" type="text/css">
    <style>
        p {
            margin: 5px 0;
        }
    </style>
</head>

<body class="white-bg" style="color:#333;padding:3px;">
         <h2 class="title_color text-center">批量维护经销商所属城市</h2>
        <form action="" method="get" class="form-inline">
        <table class="table-bordered table">
            <tr>
                <td> <label for="title">营销城市名称</label></td>
                <td>  <input type="text" name="title" id="title" value="{$title}" class="form-control"></td>
                <td> <label for="jxs_title">经销商名称</label></td>
                <td>  <input type="text" name="jxs_title" id="jxs_title" value="{$jxs_title}" class="form-control"></td>
                <td colspan="2">  <button class="btn btn-sm btn-info" type="submit" id="search">查询</button>
                <button class="btn btn-sm btn-info" type="reset" id="reset">清空条件</button></td>
            </tr>
        </table>
        </form>
        <div class="col-md-12 white-bg border_S">
            <p>操作说明：</p>
            <p>1.修改：为该城市添加经销商</p>
            <p>2.替换把该城市所属的经销商全部追加到另外一个城市，本城市的经销商将被清空</p>
        </div>
        <div class="white-bg">
            <table class="table table-bordered bud_hei table-striped text-center" id="editable">
                <tr class="info">
                    <th class="text-center">No.</th>
                    <th class="text-center">营销城市名称</th>
                    <th class="text-center">营销城市包含的经销商</th>
                    <th class="text-center">操作</th>
                </tr>
                {volist name="data" id="row"}
                <tr>
                    <td style="width: 8%">{$row.id}</td>
                    <td style="width: 16%">{$row.title}</td>
                    <td style="width: 60%">
                        {volist name="row.jxs" id="row2"}
                        {$row2.title}&nbsp;&nbsp;
                        {/volist}
                    </td>
                    <td style="width: 16%"><a href="{:url('updateview',array('id'=>$row.id))}">修改</a><a href="javascript:;" style="margin-left: 20px" class="tihuan" data-id="{$row.id}">替换</a></td>
                </tr>
                {/volist}
            </table>
           <div class="row text-center" id="pageText" style="padding: 0;margin: 0;">
					<div class="col-sm-6 text-left"><div class="padding-10 countSize">共{$count}条记录，{$maxpage}页&nbsp;&nbsp;</div></div>
					<div class="col-sm-6 text-right">{$page}</div>
			</div>
        </div>
    <!-- 全局js -->
    {include file="Public/footer"}
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
     <script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
    <script src="__STATIC__/layout/js/plugins/peity/jquery.peity.min.js"></script>

    <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script>
        $(function () {
            $('#reset').on('click',function () {
                $('input[type=text]').val('')
                $('form').submit()
            })
            $('.tihuan').on('click',function () {
                var id = $(this).data('id')
                layer.open({
                    type:2,
                    title:'替换城市',
                    area:['40%','80%'],
                    maxmin: true,
                    content:'{:url("tihuan")}?id='+id
                })
            })
        })
    </script>
</body>

</html>